package com.qf.flash.mvp.presenter;

import com.qf.flash.http.HttpManager;
import com.qf.flash.mvp.contract.ChangeGroupContract;
import com.qf.flashlib.base.BasePresenter;
import com.qf.flashlib.base.BaseSubscriber;
import com.qf.flashlib.util.RxUtils;

import java.util.Map;

public class ChangeGroupPresenter extends BasePresenter<ChangeGroupContract.View> implements ChangeGroupContract.Presenter {

    @Override
    public void changeGroup(Map<String, Object> map) {
        addSubscription(HttpManager.getInstance().getGsonHttpApi()
                .UPDATE_GAME_GROUP(map)
                .compose(RxUtils.handleResult())
                .compose(RxUtils.io_main())
                .subscribeWith(new BaseSubscriber<Object>(mRootView) {
                                   @Override
                                   public void onSuccess(Object alipayInfoBean) {
                                       mRootView.changSuccess();
                                   }
                               }
                )
        );
    }
}
